package corp.sunny.commons.util.spring;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @File:SpringUtil.java
 * @Date:Jul 6, 2011
 * @Author:Subhash Bavi
 * 
 * @Description:
 * @Copyright Sunny Corporation - 2011
 */
public class SpringUtil {

	private static BeanFactory factory;
	static {
		try {
			ApplicationContext context = new ClassPathXmlApplicationContext(
					"classpath:ssoApplicationContext.xml");
			factory = (BeanFactory) context;
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static Object getBean(String s) {
		return factory.getBean(s);
	}

}
